/**
 * 
 */
package com.numericme.locale.switcher.tools;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.util.Log;

import com.numericme.locale.switcher.MainActivity;


/**
 * This saves to SharedPreferences on media mounting which signals the wallpaper to check the media again.
 * @author yincrash
 */
public class BootInfoReceiver extends BroadcastReceiver
{

  /* (non-Javadoc)
   * @see android.content.BroadcastReceiver#onReceive(android.content.Context, android.content.Intent)
   */
  @Override
  public void onReceive(Context context, Intent intent)
  {
    String action = intent.getAction();
    
    //BOOT COMPLETED INFOS
    if (Intent.ACTION_BOOT_COMPLETED.equals(action))
    {
    	//Start MainActivity
    	final Intent intent2 = new Intent(context, MainActivity.class);
    	intent2.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		intent2.setAction(Intent.ACTION_BOOT_COMPLETED);
    	context.startActivity(intent2);
    }
  }

}
